#ifndef COMPONENTMATCH_H
#define COMPONENTMATCH_H

#include "componentSelection.h"
#include "componentCheck.h"
#include <math.h>
#include <pcl/filters/voxel_grid.h>

/*!
 \file componentMatch.h This file contains the component match functions.
 \author Sqizzato Stefano
 \author Maroso Alessandro

*/

using namespace std;
using namespace pcl;

/*!
 \brief Given a Component object of the target, the function tries to match a component of the target cloud with the same component on the source cloud by simulating a manual component selection.

 \param[in] registeredSource The source cloud where the new component has to be found.
 \param[in] targetCloud  The target cloud where the component is defined.
 \param[in] componentToFind The component on target cloud.
 \param[out] sourceComponentIndices The point indices of the component found.
 \param[in] cluster_indices The vector that contains the clusters of the registered source cloud.
*/
void componentMatchClickSimulation( PointCloud<PointXYZRGB>::Ptr registeredSource, PointCloud<PointXYZRGB>::Ptr targetCloud, Component componentToFind, PointIndices::Ptr sourceComponentIndices, vector<PointIndices> cluster_indices );




/*!
 \brief Given a Component object of the target, the function tries to match a component of the target cloud with the same component on the source cloud point by point.

 \param[in] registeredSource The source cloud where the new component has to be found.
 \param[in] componentToFind The component on target cloud.
 \param[out] sourceComponentIndices The point indices of the component found.
*/
void componentMatchShapeCutting( PointCloud<PointXYZRGB>::Ptr registeredSource, Component componentToFind, PointIndices::Ptr sourceComponentIndices );


#endif // COMPONENTMATCH_H
